package behavior.cor;

import java.math.BigDecimal;

/**
 * @author lzp
 * @Date:2023/2/27
 * @description: 责任链模式测试Demo
 */
public class CorDemo {

	public static void main(String[] args) {
		// 构造责任链
		HandlerChain chain = new HandlerChain();
		chain.addHandler(new ManagerHandler());
		chain.addHandler(new DirectorHandler());
		chain.addHandler(new CEOHandler());

		// 处理请求
		chain.process(new Request("Bob",new BigDecimal("199")));
		chain.process(new Request("小王",new BigDecimal("199")));
		chain.process(new Request("隔壁老王",new BigDecimal("1999")));
		chain.process(new Request("小龙",new BigDecimal("19999")));
	}

}
